<?php
//app版
Route::group(['namespace'=>'V1','prefix'=>'api','middleware' => ['api.auth']],function(){
    Route::group(['middleware' => ['api.login'],'namespace'=>'In'],function(){
        //个人中心
        Route::group(['prefix'=>'menu'],function(){
            Route::get('/','MenuController@index');
            Route::get('/myProjects/{num}/{page}','MenuController@myProjects');
            Route::get('/gift/{num}/{page}','MenuController@gift');
            //交易明细
            Route::get('/tradeMoney/{num}/{page}','MenuController@tradeMoney');
            //购标
            Route::get('/go/to/buy/projects/{id}','BuyProjectsController@gotoBuyProject');//
            Route::get('/buy/projects/pay','BuyProjectsController@buyProjects');//
            Route::get('/buy/project/pay/do','BuyProjectsController@launchSinaTrade');

            Route::get('/agent/user/list/{page}','MenuController@AgentUser');
            Route::get('/agent/user/detail/{id}','MenuController@AgentUserDtail');
            Route::get('/agent/work/{page}','MenuController@AgentWork');
            Route::get('/agent/next/{page}','MenuController@secondAgent');
            Route::get('/agent/nextAgentDetail/{page}/{code}','MenuController@secondAgentDetail');
//            //交易-充值
//            Route::get('/payMoney/{page}','MenuController@payMoney');
//            //交易提现-提现
//            Route::get('/outMoney/{page}','MenuController@outMoney');
        });

        //用户中心
        Route::group(['prefix'=>'user'],function(){
            Route::get('/','UserController@my');
            Route::get('/invite/{page}','UserController@invite');//邀请好友
            Route::get('/bag','UserController@wallet');//我的钱包

            //生成新浪支付账户
            Route::get('/creat','UserController@creatSinaUser');
            //实名认证
            Route::get('/ca/certify/name','UserController@certification');
            //手机验证
            Route::get('/ca/bind/phone','UserController@bindPhone');
            Route::get('/ca/edit/phone','UserController@editPhone');
            //邮箱验证
            Route::get('/ca/be/{email}','UserController@bindEmail');
            Route::get('/ca/ee/{email}/{r_email}','UserController@editEmail');
            //修改密码
            Route::get('/ca/dp','UserController@editPIn');
            //设置sina支付密码
            Route::get('/set/payPassword','UserMoneyController@setUserPayPassword');//设置支付密码
            //绑定银行卡
            Route::get('/bb/card','UserMoneyController@bindBankCard');
            Route::get('/bb/card/do','UserMoneyController@doBindBankCard');//绑定银行卡-推进

            //解绑银行卡
            Route::get('/ub/card','UserMoneyController@unBindBankCard');
            Route::get('/ub/card/do/{code}','UserMoneyController@doUnBindBankCard');//解绑银行卡-推进

            //充值——提现
            Route::get('/deposit/{money}','UserMoneyController@payMoney');//充值
            Route::get('/withdraw/{money}','UserMoneyController@outMoney');//提现

            //查询银行卡
            Route::get('/fb/card/pay','UserMoneyController@findBankCard');
        });

        Route::get('/logout','LogoutController@out');
        Route::get('/message/{page}','MessageController@getMessage');

    });
    Route::group(['namespace'=>'Out'],function(){
         //活动中心
         Route::group(['prefix'=>'activity'],function(){
             Route::get('/{cate}/{page}','ActivityController@activity');
         });
        //新闻公告
        Route::group(['prefix'=>'articles'],function(){
            Route::get('/about/us','ArticlesController@AboutUs');//关于我们
            Route::get('/question/{cate}','ArticlesController@allQuestion');//帮助中心
            Route::get('/{num}/{page}','ArticlesController@newsArticles');//新闻公告
            Route::get('/{id}','ArticlesController@oneArticles');//单篇文章或者活动的详情

        });
        //投资项目
        Route::group(['prefix'=>'projects'],function(){
            Route::get('/all/{num}/{page}','ProjectsController@allProjects');
            Route::get('/{id}','ProjectsController@oneProjects');//关于我们
            Route::get('/profit/{id}/{money}','ProjectsController@getThisProfit');//获取预期收益
            Route::get('/users/{id}/{page}','ProjectsController@oneUserTail');//获取投资人明细
            Route::get('/info/articles','ProjectsController@oneProjectsArticle');//获取项目信息
        });
        //首页
        Route::group(['prefix'=>'homePage'],function(){
            Route::get('/nav','HomePageController@navigation');
            Route::get('/projects/{num}','HomePageController@projects');
        });
        //注册
        Route::group(['prefix'=>'register'],function(){
           Route::get('/','ApiRegisterController@register');
        });
        //登录
        Route::group(['prefix'=>'login'],function(){
            Route::get('/','ApiLoginController@login');
        });
        //
        Route::get('/restart/abc/{my_status}','RestartController@abc');//重定向
        Route::get('/phone/code','RestartController@createCode');//发送手机验证码
        Route::get('/phone/vc','RestartController@verifyCode');//验证手机号码
        Route::get('/phone/rp','RestartController@ReditPIn');//修改密码
        Route::get('/login/read','RestartController@rlogin');//登录错误
        Route::get('/test/api','RestartController@testAPI');//登录错误
        Route::get('/send/phone/code','RestartController@sendPhoneCode');//测试发送手机验证码
        Route::get('/send/email/code','RestartController@sendEmailCode');//测试发送手机验证码
    });
});
Route::get('/api_user/{id}/emailvalidate/{code}','V1\Out\RestartController@verifyEmail');//验证邮箱
Route::get('/api_user/test','V1\Out\ApiRegisterController@test');
Route::get('/api_user/count_register','V1\Out\ApiRegisterController@count_register');//百度统计

//微信版
Route::group(['namespace'=>'weixin','prefix'=>'weixin'],function(){
    Route::group(['prefix'=>'api','middleware' => ['api.auth']],function(){
        Route::group(['middleware' => ['api.login'],'namespace'=>'In'],function(){
            //个人中心
            Route::group(['prefix'=>'menu'],function(){
                Route::get('/','MenuController@index');
                Route::get('/myProjects/{num}/{page}','MenuController@myProjects');
                Route::get('/gift/{num}/{page}','MenuController@gift');
                //交易明细
                Route::get('/tradeMoney/{num}/{page}','MenuController@tradeMoney');
                //购标
                Route::get('/go/to/buy/projects/{id}','BuyProjectsController@gotoBuyProject');//
                Route::get('/buy/projects/pay','BuyProjectsController@buyProjects');//
                Route::get('/buy/project/pay/do','BuyProjectsController@launchSinaTrade');

                Route::get('/agent/user/list/{page}','MenuController@AgentUser');
                Route::get('/agent/user/detail/{id}','MenuController@AgentUserDtail');
                Route::get('/agent/work/{page}','MenuController@AgentWork');
                Route::get('/agent/next/{page}','MenuController@secondAgent');
                Route::get('/agent/nextAgentDetail/{page}/{code}','MenuController@secondAgentDetail');
//            //交易-充值
//            Route::get('/payMoney/{page}','MenuController@payMoney');
//            //交易提现-提现
//            Route::get('/outMoney/{page}','MenuController@outMoney');
            });

            //用户中心
            Route::group(['prefix'=>'user'],function(){
                Route::get('/','UserController@my');
                Route::get('/invite/{page}','UserController@invite');//邀请好友
                Route::get('/bag','UserController@wallet');//我的钱包

                //生成新浪支付账户
                Route::get('/creat','UserController@creatSinaUser');
                //实名认证
                Route::get('/ca/certify/name','UserController@certification');
                //手机验证
                Route::get('/ca/bind/phone','UserController@bindPhone');
                Route::get('/ca/edit/phone','UserController@editPhone');
                //邮箱验证
                Route::get('/ca/be/{email}','UserController@bindEmail');
                Route::get('/ca/ee/{email}/{r_email}','UserController@editEmail');
                //修改密码
                Route::get('/ca/dp','UserController@editPIn');
                //设置sina支付密码
                Route::get('/set/payPassword','UserMoneyController@setUserPayPassword');//设置支付密码
                //绑定银行卡
                Route::get('/bb/card','UserMoneyController@bindBankCard');
                Route::get('/bb/card/do','UserMoneyController@doBindBankCard');//绑定银行卡-推进

                //解绑银行卡
                Route::get('/ub/card','UserMoneyController@unBindBankCard');
                Route::get('/ub/card/do/{code}','UserMoneyController@doUnBindBankCard');//解绑银行卡-推进

                //充值——提现
                Route::get('/deposit/{money}','UserMoneyController@payMoney');//充值
                Route::get('/withdraw/{money}','UserMoneyController@outMoney');//提现

                //查询银行卡
                Route::get('/fb/card/pay','UserMoneyController@findBankCard');
            });

            Route::get('/logout','LogoutController@out');
            Route::get('/message/{page}','MessageController@getMessage');

        });
        Route::group(['namespace'=>'Out'],function(){
            //活动中心
            Route::group(['prefix'=>'activity'],function(){
                Route::get('/{cate}/{page}','ActivityController@activity');
            });
            //新闻公告
            Route::group(['prefix'=>'articles'],function(){
                Route::get('/about/us','ArticlesController@AboutUs');//关于我们
                Route::get('/question/{cate}','ArticlesController@allQuestion');//帮助中心
                Route::get('/{num}/{page}','ArticlesController@newsArticles');//新闻公告
                Route::get('/{id}','ArticlesController@oneArticles');//单篇文章或者活动的详情

            });
            //投资项目
            Route::group(['prefix'=>'projects'],function(){
                Route::get('/all/{num}/{page}','ProjectsController@allProjects');
                Route::get('/{id}','ProjectsController@oneProjects');//关于我们
                Route::get('/profit/{id}/{money}','ProjectsController@getThisProfit');//获取预期收益
                Route::get('/users/{id}/{page}','ProjectsController@oneUserTail');//获取投资人明细
                Route::get('/info/articles','ProjectsController@oneProjectsArticle');//获取项目信息
            });
            //首页
            Route::group(['prefix'=>'homePage'],function(){
                Route::get('/nav','HomePageController@navigation');
                Route::get('/projects/{num}','HomePageController@projects');
            });
            //注册
            Route::group(['prefix'=>'register'],function(){
                Route::get('/','ApiRegisterController@register');
            });
            //登录
            Route::group(['prefix'=>'login'],function(){
                Route::get('/','ApiLoginController@login');
            });
            //
            Route::get('/restart/abc/{my_status}','RestartController@abc');//重定向
            Route::get('/phone/code','RestartController@createCode');//发送手机验证码
            Route::get('/phone/vc','RestartController@verifyCode');//验证手机号码
            Route::get('/phone/rp','RestartController@ReditPIn');//修改密码
            Route::get('/login/read','RestartController@rlogin');//登录错误
            Route::get('/test/api','RestartController@testAPI');//登录错误
            Route::get('/send/phone/code','RestartController@sendPhoneCode');//测试发送手机验证码
            Route::get('/send/email/code','RestartController@sendEmailCode');//测试发送邮箱验证码
            Route::get('/create/qr/code','RestartController@createQrCode');//测试发送邮箱验证码
        });
    });
});

